<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button>???????</button>
    <button>zzzzzzz</button>
    <div class="div"></div>
    <div class="ddv"></div>
    <script>
        // console.log(window.innerHeight);
        // console.log(window.innerWidth)
        // console.log(window.navigator)

        // var btn1 = document.querySelectorAll("button");
        // btn1[0].onclick=function(){
        //     window.open("http://www.baidu.com");
        // }
        // btn1[1].onclick=function(){
        //     window.close();
        // }
        // btn1[2].onclick=function(){
        //     console.log(window.location.href)
        // }
        
        var btn = document.querySelectorAll("button")
        var div = document.querySelector(".div")
        var ddv = document.querySelector(".ddv")
        btn[0].onclick = function(){
            window.location.hash = "qq1"
            fn()
        }
        btn[1].onclick = function(){
            window.location.hash = "qq2"
            fn()
        }
      
        function fn(){
            if(window.location.hash = "qq1"){
                div.innerHTML = "嗡嗡嗡嗡嗡嗡"
            }else if(window.location.hash = "qq2"){
                ddv.innerHTML = "噢噢噢噢噢噢噢噢哦哦"
            }else{
                div.innerHTML = "臭弟弟写啥呢？"
            }
        }
    </script>
</body>
</html>